#include <stdio.h>
#include <stdlib.h>

int val = 100;
int unval;

int main(int argc, char *argv[], char *env[])
{

    printf("code address: %p\n ",main);    //代码区
    printf("init address: %p\n",&val);      //已初始化数据区
    printf("uninit address: %p\n",&unval);  //未初始化数据区
    char *heap = (char*)malloc(10);       
    printf("heap address: %p\n",heap);     //堆区
    printf("stack address: %p\n", &heap);     //栈区

    printf("command line arg address: %p\n", argv[0]);
    printf("command line arg address: %p\n", argv[argc-1]);

    printf("env address: %p\n", env[0]);

    return 0;
}
